package com.stars.easyms.logger.support.log4j12;

import com.stars.easyms.logger.EasyMsLogger;
import org.slf4j.ILoggerFactory;
import org.slf4j.Logger;
import org.slf4j.impl.Log4jLoggerFactory;

/**
 * <p>className: EasyMsLog4j12LoggerContext</p>
 * <p>description: EasyMs的日志上下文</p>
 *
 * @author guoguifang
 * @date 2019-08-15 22:37
 * @since 1.3.0
 */
public final class EasyMsLog4j12LoggerContext implements ILoggerFactory {

    private static final EasyMsLog4j12LoggerContext SINGLETON = new EasyMsLog4j12LoggerContext();

    private ILoggerFactory loggerFactory = new Log4jLoggerFactory();

    public static EasyMsLog4j12LoggerContext getSingleton() {
        return SINGLETON;
    }

    @Override
    public Logger getLogger(String name) {
        return new EasyMsLogger(loggerFactory.getLogger(name));
    }

    private EasyMsLog4j12LoggerContext() {
    }
}